Skip to content

fix(linux): deadlock in WebViewUriLoader#1561

Merged
lucasfernog merged 3 commits into
tauri-apps:devfrom
dgerhardt:fix-webkitgtk-webviewuriloader-deadlock
Aug 16, 2025
Merged

fix(linux): deadlock in WebViewUriLoader#1561
lucasfernog merged 3 commits into
tauri-apps:devfrom
dgerhardt:fix-webkitgtk-webviewuriloader-deadlock

Conversation

@dgerhardt
Copy link
Copy Markdown
Contributor

@dgerhardt dgerhardt commented Jun 3, 2025

This fixes a deadlock, which could occur on Linux, when a WebView was destroyed before handling LoadEvent::Finished. As a consequence, no further requests could be performed.

With this fix, tauri-apps/tauri#12589 is no longer consistently reproducible. But there still seem to be rare situations, in which a deadlock could occur, so I don't think the issue can be closed.

Note: This PR could be slightly improved by disconnecting the connect_destroy signal handler when LoadEvent::Finished is handled. But I'm not experienced in Rust development at all and have no idea how to move the SignalHandlerId into the closure to call webview.disconnect(id).

Additional context / long-term solution

The deadlock is caused by a workaround for a supposed bug in WebKitGTK. But the workaround introduces new bugs and negatively impacts request performance by queuing them up. Ideally, the underlying issue would be further investigated, so the workaround could be removed in the future. Currently, there doesn't seem to be an issue to track this problem and the bug has not been reported to the WebKitGTK project. As a start, it would be helpful to allow disabling the workaround. This way, it would be possible to verify if it is still needed for the latest WebKitGTK version.

Refs #359

A deadlock could occur, when a WebView was destroyed before handling
`LoadEvent::Finished`.

Refs tauri-apps/tauri#12589
@dgerhardt dgerhardt requested a review from a team as a code owner June 3, 2025 13:04
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 4, 2025

Package Changes Through c33b46c

There are 1 changes which include wry with minor

Planned Package Versions

The following package releases are the planned based on the context of changes in this pull request.

package current next
wry 0.52.1 0.53.0

Add another change file through the GitHub UI by following this link.


Read about change files or the docs at github.com/jbolda/covector

@dgerhardt
Copy link
Copy Markdown
Contributor Author

@chippers @wusyong Could you have a look at this PR? It is related to a workaround introduced with #359, which you submitted/reviewed.

Copy link
Copy Markdown
Member

@lucasfernog lucasfernog left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice catch, thanks!

@lucasfernog lucasfernog merged commit 88cbb01 into tauri-apps:dev Aug 16, 2025
13 of 14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants